1. Field of the Invention
The present invention relates to an IC card with a built-in coprocessor for an auxiliary arithmetic such as cryptographic processing and, more specifically, to a technique, which is applicable to all IC cards of a non-contact type, a contact type and a combination type, for improving an efficiency of a communication protocol between an IC card and an external device.
2. Description of the Related Art
An IC card comprising a plastic card and an IC chip (semiconductor integrated circuit device) such as a nonvolatile memory, a CPU or a cryptographic coprocessor mounted thereon, as compared with a widely-used magnetic card, can handle a greater amount of data and is superior in security. Therefore, the use of the IC card has begun to extend in various applications. The IC card is classified into a contact type, a non-contact type or a combination type. The contact type IC card having metal terminals arranged on the surface thereof is inserted into an external reader/writer, so that power is supplied and the data is exchanged through the terminals. In the non-contact type IC card, an antenna coil is brought into a magnetic field generated by a reader/writer using an electromagnetic induction technique thereby to supply power or to exchange data with radio wave (carrier frequency of, for example, several to several tens of MHz). The combination type IC card has interfaces of both contact and non-contact types. In recent years, the non-contact type IC card has begun to be widely used for its operating convenience.
(Problem Regarding Power Supply of Non-Contact Type IC Card)
In non-contact communication using the non-contact type IC card or the combination type IC card, power is supplied to the IC card from a reader/writer by electromagnetic induction. Therefore, the IC card cannot be driven with a large capacity of power and has only a small capacity of power supply. In the non-contact type IC card, therefore, power consumption is required to be minimized. The currently available IC card consumes a considerable amount of current for reading, writing or erasing the data in the nonvolatile memory or by a coprocessor for cryptographic operation described above, and therefore the problem is posed how to supply power in a non-contact manner.
(Problem Regarding Communication in Non-Contact IC Card)
The communication method of the proximity non-contact type IC card is standardized by ISO 14443 type B (ASK 10%), for example, and uses the low-depth modulation. The low-depth modulation is defined as a communication with a low modulation rate of, e.g., 10%, the modulation rate being defined by the following expression (1) with respect to the maximum width Amax and the minimum width Amin of a signal used for the communication.Modulation rate=(Amax−Amin)/(Amax+Amin)  (1)
In the low-depth modulation, a slight voltage change affects the communication quality. During communication, therefore, it is indispensable to suppress the current consumption as far as possible. Because of this restriction, the arithmetic operation of the coprocessor and the writing, erasing or reading operations of the nonvolatile memory are conventionally difficult to perform during communication.
(Problem Regarding Setting of Frame Waiting Time)
An initial response in communication between the non-contact type IC card and the reader/writer is standardized by ISO 14443-3. A processing flowchart of the non-contact type IC card is shown in FIG. 1.
A protocol for communication between the non-contact type IC card and the reader/writer after initial response is also standardized by ISO 14443-4.
The initial response is started by the fact that the power supply of the non-contact type IC card is turned on by the energy from the reader/writer and a REQB command is sent from the reader/writer to the IC card. The REQB command is to request the non-contact type IC card to make preparation and contains an application field identifier (AFI), an attribute information parameter (PARM) and a circuit redundancy check code (CRC).
The non-contact type IC card that has received the REQB command detects the coincidence of the application field identifier (AFI) in the REQB command, determines the upper limit of the number N (N=1 in this embodiment) of the non-contact type IC cards from the attribute information (PARM) and, then, returns an ATQB response to the reader/writer. The ATQB response is a request response signal to the REQB command and contains information such as a pseudo unique identifier (PUPI), application information (application data), protocol information and a circuit redundancy check code (CRC). By receiving the ATQB response, the reader/writer acquires the information.
Once the non-contact type IC card returns the ATQB response, receives an ATTRIB command and returns an ATTRIB response, then the initial response is completed and the non-contact type IC card proceeds to an active mode.
After that, communication is carried out between the non-contact type IC card and the reader/writer with the protocol standardized by ISO 14443-4.
Normally, the reader/writer transmits a command to the non-contact type IC card using the protocol described above. The non-contact type IC card executes the process corresponding to the received command and transmits the result of executing the command to the reader/writer. The non-contact type IC card, upon receipt of a DESELECT command by the S block from the reader/writer, proceeds to the halt mode. As long as the non-contact type IC card is in halt mode, only the WUPB command can be received from the reader/writer. The WUPB command permits the non-contact type IC card to perform the operation from and including the detection of AFI coincidence again of all the initial response operations.
The protocol information contained in the ATQB response to the REQB command at the time of initial response includes the parameters required by the non-contact type IC card for communication such as the bit transmission rate and the maximum frame size, which in turn includes the parameter FWI used by the reader/writer to set the frame waiting time. The reader/writer, after receipt of FWI, executes the calculation of the following expression (2) and sets the frame waiting time FWT.FWT=(256×16/fc)×2FWI  (2)
In the above expression (2), fc is the carrier frequency generated by the reader/writer and standardized as 13.56 MHz. According to the ISO standard, FWI is assigned the value of 0 to 14 (corresponding to FWT of about 302 μs to about 4949 ms). The specific value of FWI to be employed is determined by the non-contact type IC card. Therefore, the non-contact type IC card is required to complete the internal process thereof within the time corresponding to the FWI transmitted to the reader/writer. In the case where the non-contact type IC card fails to complete the internal process within the particular time, the reader/writer is permitted to handle the process as a time-out error. During the protocol communication according to ISO 14443-4, assume that the non-contact type IC card fails to complete the process within the frame waiting time of the reader/writer. The non-contact type IC card is required to request the reader/writer to extend the frame waiting time and extend the time-out error determination time of the reader/writer. The communication command between the reader/writer and the non-contact type IC card for extension of the frame waiting time is specified by the protocol standard of ISO 14443-4. Currently, the long internal process required of the non-contact type IC card includes the arithmetic for various encryption/decryption requiring the coprocessor arithmetic.
In the case where FWI is set to a value as large as 14 in the initial response, for example, long time-out determination time is always set in the reader/writer. Under such a condition, a fault occurs in the internal process or communication of the non-contact type IC card for other commands requiring no time extension, and the reader/writer cannot correctly receive the response of the non-contact type IC card to the command from the reader/writer. Then, the reader/writer undesirably would consume more time than necessary to determine the fault of time-out error, resulting in a deteriorated performance. Therefore, the FWI for the initial response is desirably set to as small a value as possible taking the overall performance of the IC card system into consideration.
In the case where the FWI is set to a value as small as 4, for example, taking the performance of the IC card system into consideration, however, the coprocessor arithmetic may require the arithmetic time longer than the frame waiting time of the reader/writer.
To cope with this problem of setting the frame waiting time, a method might be conceived in which communication is established between the reader/writer and the non-contact type IC card for extending the frame waiting time utilizing the timer interrupt or the like during the coprocessor arithmetic. The request (communication) issued for extending the frame waiting time during the arithmetic of the coprocessor, however, adds the communication process to the original arithmetic process and increases the power consumption. As a result, the communication distance of the non-contact type IC card is shortened or the communication stability is reduced. Therefore, it is difficult to improve the efficiency by this method.
Also, the processing time of the coprocessor arithmetic varies with the type of arithmetic executed by the arithmetic coprocessor and the parameter applied to the arithmetic coprocessor. Currently, a plurality of cryptographic processes or a plurality of parameter processes even for a single cryptographic process are required, and it is difficult to predict the need to extend the frame waiting time by tabling the processing time in advance. As far as the non-contact type IC card currently used is concerned, therefore, the communication is carried out to extend the frame waiting time and the extension of the frame waiting time is set in the reader/writer before executing all the coprocessor arithmetic. Setting the frame waiting time in the reader/writer is a temporary process, and the frame waiting time of the reader/writer is restored to the initial value upon completion of one command process of the non-contact type IC card (upon transmission of the response to the command to the reader/writer).
An example of the conventional method of setting the frame waiting time is shown in FIG. 2. According to the conventional method shown in FIG. 2, the reader/writer and the non-contact type IC card operate as described below in accordance with the ISO 14443-4 protocol. In FIG. 2, R/W designates the reader/writer and ICC the non-contact type IC card.
(1) The reader/writer transmits a command to the non-contact type IC card by the I block. The non-contact type IC card receives the command and determines the type of the command.
(2) In the case where the command received in (1) requires the operation of the arithmetic coprocessor, the non-contact type IC card transmits a frame waiting time extension request (WTX request of S block) to the reader/writer before starting the arithmetic of the coprocessor.
(3) In accordance with the WTX request of the S block, the reader/writer extends the frame waiting time. The reader/writer thus sends a frame waiting time extension response (WTX response of S block) to the non-contact type IC card.
(4) The non-contact type IC card executes the command (arithmetic process of the coprocessor).
(5) The non-contact type IC card, upon complete execution of the command, sends the result of command execution to the reader/writer by the I block.
The conventional method of setting the frame waiting time described above, however, has at least two problems. Firstly, the communication to extend the frame waiting time even for the coprocessor arithmetic not requiring the extension of the frame waiting time (short in processing time) is carried out. Therefore, the waste of time is caused by the additional transmitting and receiving operation, thereby deteriorating the efficiency of communication between the reader/writer and the non-contact type IC card. Secondly, the communication required for frame waiting time extension before the coprocessor arithmetic undesirably provides a trigger to notify the offender of the analysis points such as key information on the encrypting and decrypting operation, often leading to a security problem.